import sys
try:
    import pygtk
    pygtk.require("2.0")
except:
    pass
try:
    import gtk
    import gtk.glade
except:
    sys.exit(1)

test = "truc"

test


class PyNetStatsGUI():
    def __init__(self):
        self.__gladefile = "pynetstats.glade"
        self.__interface = gtk.Builder()
        self.__interface.add_from_file(self.__gladefile)
        self.__window = self.__interface.get_object("main")
        self.autoConnect()
        

    def autoConnect(self):
        signals = {}
        for method in dir(self):
            if method.find("pns_") == 0:
                signals[str(method)[4:]] = getattr(self,method)
        self.__interface.connect_signals(signals)

    def pns_on_main_destroy(self,widget):
        gtk.main_quit()




if __name__ == "__main__":
    
    gui = PyNetStatsGUI()
    gtk.main()